/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package test_system.user_logic;

import java.util.ArrayList;
import test_system.questions.Answer;

/**
 *
 * @author user
 */
public class UserAnswers {

    ArrayList<Answer> userAnswers = new ArrayList<>();

    public UserAnswers(ArrayList<Answer> userAnswers) {
        this.userAnswers = userAnswers;
    }

    public int[] evaluation() {
        int mark = 0;
        for (Answer answer : userAnswers) {
            if (answer.isRight()) {
                mark++;
            }
        }
        return new int[]{
            mark, userAnswers.size()
        };

    }

}
